package com.ruoyi.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mapper.ErpPurchaseReconciliationMapper;
import com.ruoyi.domain.ErpPurchaseReconciliation;
import com.ruoyi.service.IErpPurchaseReconciliationService;

/**
 * 采购对账Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-07-17
 */
@Service
public class ErpPurchaseReconciliationServiceImpl implements IErpPurchaseReconciliationService 
{
    @Autowired
    private ErpPurchaseReconciliationMapper erpPurchaseReconciliationMapper;

    /**
     * 查询采购对账
     * 
     * @param id 采购对账主键
     * @return 采购对账
     */
    @Override
    public ErpPurchaseReconciliation selectErpPurchaseReconciliationById(String id)
    {
        return erpPurchaseReconciliationMapper.selectErpPurchaseReconciliationById(id);
    }

    /**
     * 查询采购对账列表
     * 
     * @param erpPurchaseReconciliation 采购对账
     * @return 采购对账
     */
    @Override
    public List<ErpPurchaseReconciliation> selectErpPurchaseReconciliationList(ErpPurchaseReconciliation erpPurchaseReconciliation)
    {
        return erpPurchaseReconciliationMapper.selectErpPurchaseReconciliationList(erpPurchaseReconciliation);
    }

    /**
     * 新增采购对账
     * 
     * @param erpPurchaseReconciliation 采购对账
     * @return 结果
     */
    @Override
    public int insertErpPurchaseReconciliation(ErpPurchaseReconciliation erpPurchaseReconciliation)
    {
        erpPurchaseReconciliation.setCreateTime(DateUtils.getNowDate());
        return erpPurchaseReconciliationMapper.insertErpPurchaseReconciliation(erpPurchaseReconciliation);
    }

    /**
     * 修改采购对账
     * 
     * @param erpPurchaseReconciliation 采购对账
     * @return 结果
     */
    @Override
    public int updateErpPurchaseReconciliation(ErpPurchaseReconciliation erpPurchaseReconciliation)
    {
        erpPurchaseReconciliation.setUpdateTime(DateUtils.getNowDate());
        return erpPurchaseReconciliationMapper.updateErpPurchaseReconciliation(erpPurchaseReconciliation);
    }

    /**
     * 批量删除采购对账
     * 
     * @param ids 需要删除的采购对账主键
     * @return 结果
     */
    @Override
    public int deleteErpPurchaseReconciliationByIds(String[] ids)
    {
        return erpPurchaseReconciliationMapper.deleteErpPurchaseReconciliationByIds(ids);
    }

    /**
     * 删除采购对账信息
     * 
     * @param id 采购对账主键
     * @return 结果
     */
    @Override
    public int deleteErpPurchaseReconciliationById(String id)
    {
        return erpPurchaseReconciliationMapper.deleteErpPurchaseReconciliationById(id);
    }
}
